/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package propres;
import java.awt.event.*;
import javax.swing.*;
/**
 *
 * @author neochange
 */
public class CtrlVistaPersona {

private CtrlDominioPersona driver = new CtrlDominioPersona();   
// El controlador de vista gestiona los datos que entran y salen de las vistas
// No tiene atributos
    
    
// Métodos:

public CtrlVistaPersona(){}

public CtrlVistaPersona(String i,String a,String dn,String d) throws Exception
{
String[] T = new String[4];
T[0]=i;
T[1]=a;
T[2]=dn;
T[3]=d;
driver.Alta_Persona(T);
}

public CtrlDominioPersona Get_contr(){
return driver;
}
    
public String[] gestion_evento(String Y,String a,String b,String c,String d) throws Exception
{

    
    String[] D = new String[4];
    
    if(Y.equals("Dar Alta")){
    D[0]=a;
    D[1]=b;
    D[2]=c;
    D[3]=d;
    driver.Alta_Persona(D);
    D = new String[4];
    }
    else if(Y.equals("Consultar Persona")){
    
     D=driver.Consultar_Persona(c);
            
    }
    else if(Y.equals("Modificar Persona")){
    D[0]=a;
    D[1]=b;
    D[2]=c;
    D[3]=d;
    driver.Modificar_Persona(D);
    D = new String[4];
    }
    
return D;    
}


}
